package com.duobab.springbootsecuritydemo.controller;

import com.duobab.springbootsecuritydemo.security.SsoContextHolder;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HelloController {
    @RequestMapping(method = RequestMethod.GET)
    public String getIndex() throws JsonProcessingException {
        return "Hello: " + SsoContextHolder.getUserInfo().getUsername();
    }
}
